# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=bogofilter
pkgver=1.2.5
pkgrel=3
pkgdesc="Fast Bayesian spam filter"
url="https://bogofilter.sourceforge.io/"
arch="all"
license="GPL-2.0-or-later"
makedepends="sqlite-dev"
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/project/bogofilter/bogofilter-stable/bogofilter-$pkgver.tar.xz"

prepare() {
	default_prepare

	update_config_guess
	update_config_sub
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-included-gsl \
		--with-database=sqlite3 \
		CFLAGS="$CFLAGS -I/usr/include/fortify/sys"
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
3a7280485cfe5802dd3e9721c153f88ccf28bff7a6a24590e985e860d1f1e0ddea7bde8a8e5ad1ff643e94c9fd7b26b2a5ed5a9fb991cee3fd5b0ce67ce9abfe  bogofilter-1.2.5.tar.xz
"
